package com.maixun.lib_comment

import android.annotation.SuppressLint
import android.content.Context
import androidx.multidex.MultiDexApplication
import com.alibaba.android.arouter.launcher.ARouter
import com.maixun.lib_base.utils.SharedPrefUtil
import com.maixun.lib_network.OSSManager

/**
 * @author：Lmoumou
 * @date：2020/9/17
 */
open class CommentApplication : MultiDexApplication() {

    companion object {
        @SuppressLint("StaticFieldLeak")
        lateinit var mContext: Context
    }

    override fun onCreate() {
        super.onCreate()
        mContext = this

        SharedPrefUtil.init(this)

        ARouter.init(this)
        ARouter.openDebug()
        ARouter.openLog()

        OSSManager.init(this.applicationContext)
    }

    override fun onTerminate() {
        super.onTerminate()
        ARouter.getInstance().destroy()
    }
}